
#include <iostream>
#include <vector>
#include "ConfReader.h"

using namespace std;

int main(int argc, char* argv[])
{

	if(argc < 2) {
		printf("Config_reader <cfg_file>\n");
		return 0;
	};

	ConfReader cr;
	cr.read_config(argv[1]);

	std::vector<int> ints;
	string key = "_x";
	cr.getInts(key, ints);
	cout << "Global x=" << ints[0] << endl;
	ints.clear();

	key = "_y";
	cr.getInts(key, ints);
	cout << "Global y=" << ints[0] << endl;
	ints.clear();

	key = "load_file";
	string fname;
	cr.getString(key, fname);
	cout << "Image file to load=" << fname << endl;
	
	key = "load_pos";
	cr.getInts(key, ints);
	cout << "Image x=" << ints[0] << " y=" << ints[1] << endl;
	ints.clear();

	key = "load_width";
	cr.getInts(key, ints);
	cout << "Image width=" << ints[0] << endl;
	ints.clear();

	key = "load_height";
	cr.getInts(key, ints);
	cout << "Image height=" << ints[0] << endl;
	ints.clear();

	key = "load_d";
	std::vector<double> d;
	cr.getDoubles(key, d);
	cout << "And some doubles from \'load\' section ->";

	for(int i=0; i<d.size(); i++)
		cout << "(" << d[i] << ")";
	cout << endl;

	return 0;
};
